﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


class valueOfAGivenBit
{
    static void Main(string[] args)
    {
        Console.WriteLine("Enter int I:");
        int i = Convert.ToInt32(Console.ReadLine());
        Console.WriteLine("Enter bit number b:");
        int b = Convert.ToInt32(Console.ReadLine());
        int position = b;
        int masq = 1 << position;
        int iAndMasq = (i & masq);
        int bit = iAndMasq >> position;
        Console.WriteLine(bit);
    }
}

